﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.ComponentModel.DataAnnotations;

namespace VERKProjectHopur16.Models
{
    public class UserViewModel
    {
        #region Repository instance
        DataRepository m_rep = new DataRepository();
        #endregion

        #region  Constructor
        public UserViewModel()
        {
            Roles = new List<SelectListItem>();
            foreach (var item in m_rep.AllRoles())
            {
                Roles.Add(new SelectListItem { Text = item.aspnet_Role.RoleName, Value = item.aspnet_Role.RoleName });
            }
            Roles.Add(new SelectListItem { Text = "Regular User", Value = "None" });
        }
        #endregion

        #region Properties
        public String UserName { get; set; }

        public String OldRole { get; set; }

        public String RoleName { get; set; }

        public List<SelectListItem> Roles { get; set; }
        #endregion
    }
}